<?php
$smarty->configLoad($lang . '/rule.module.php');
$language = parse_ini_file($lang . '/breadcrumb.module.php', true);
$breadcrumb = $language['edit_rule'];

	$sql = 'SELECT * FROM '.DB_CMS.'.module_rules WHERE id = :id';
	$qry3 = $connection->prepare($sql);
	$qry3->bindValue(':id', $_GET['id']);
	$qry3->execute();
	$title = $qry3->fetch(PDO::FETCH_ASSOC);
	$smarty->assign('name', $title['name']);
	$smarty->assign('id', $title['id']);
	
	$sql = 'SELECT * FROM '.DB_CMS.'.module_rules_points WHERE ruleID = :ruleID';
	$qry = $connection->prepare($sql);
	$qry->bindValue(':ruleID', $_GET['id']);
	$qry->execute();
	$count = 1;
	while ($row = $qry->fetch(PDO::FETCH_ASSOC)) {
		$count++;
		$value[] = $row;
	}
	$smarty->assign('count', $count);
	$smarty->assign('from', $value);
	$template = 'rules/edit.tpl';

?>
